CVE-2022-39394
wasmtime_trap_code C API function has out of bounds write vulnerability
Description
Wasmtime is a standalone runtime for WebAssembly. Prior to version 2.0.2, there is a bug in Wasmtime's C API implementation where the definition of the `wasmtime_trap_code` does not match its declared signature in the `wasmtime/trap.h` header file. This discrepancy causes the function implementation to perform a 4-byte write into a 1-byte buffer provided by the caller. This can lead to three zero bytes being written beyond the 1-byte location provided by the caller. This bug has been patched and users should upgrade to Wasmtime 2.0.2. This bug can be worked around by providing a 4-byte buffer casted to a 1-byte buffer when calling `wasmtime_trap_code`. Users of the `wasmtime` crate are not affected by this issue, only users of the C API function `wasmtime_trap_code` are affected.
INFO
Published Date :
Nov. 10, 2022, 8:15 p.m.
Last Modified :
Nov. 21, 2024, 7:18 a.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source | 
|---|---|---|---|---|---|---|
| CVSS 3.1 | LOW | [email protected] | ||||
| CVSS 3.1 | CRITICAL | [email protected] | 
Solution
- There is no known solution at this time.
 
References to Advisories, Solutions, and Tools
                                            Here, you will find a curated list of external links that provide in-depth
                                            information, practical solutions, and valuable tools related to
                                            CVE-2022-39394.
                                        
| URL | Resource | 
|---|---|
| https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36 | Patch Third Party Advisory | 
| https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q | Third Party Advisory | 
| https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36 | Patch Third Party Advisory | 
| https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q | Third Party Advisory | 
CWE - Common Weakness Enumeration
            While CVE identifies
            specific instances of vulnerabilities, CWE categorizes the common flaws or
            weaknesses that can lead to vulnerabilities. CVE-2022-39394 is
            associated with the following CWEs:
        
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
            (CAPEC)
            stores attack patterns, which are descriptions of the common attributes and
            approaches employed by adversaries to exploit the CVE-2022-39394
            weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
			The following list is the news that have been mention
			CVE-2022-39394 vulnerability anywhere in the article.
		
                The following table lists the changes that have been made to the
                CVE-2022-39394 vulnerability over time.
            
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
- 
                            
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36 Added Reference https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q  - 
                            
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value  - 
                            
Initial Analysis by [email protected]
Nov. 16, 2022
Action Type Old Value New Value Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Changed Reference Type https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36 No Types Assigned https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36 Patch, Third Party Advisory Changed Reference Type https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q No Types Assigned https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q Third Party Advisory Added CWE NIST CWE-787 Added CPE Configuration OR *cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:* versions up to (excluding) 1.0.2 *cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:* versions from (including) 2.0.0 up to (excluding) 2.0.2  
Vulnerability Scoring Details
Base CVSS Score: 9.8
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.04 }} -0.01%
score
0.13131
percentile